#!/usr/bin/env python
# encoding: utf-8
'''
@author: Excelsiorly
@license: (C) Copyright 2021, All Rights Reserved.
@contact: excelsiorly@qq.com
@file: 0004.py.py
@time: 2021/9/7 20:39
@desc:
'''

class Solution:
    def fib(self, n: int) -> int:
        f_lib = [0 for i in range(n+1)]
        f_lib[0], f_lib[1] = 0, 1

        for i in range(2, n+1):
            f_lib[i] = f_lib[i - 1] + f_lib[i - 2]

        return int(f_lib[n] % (1e9 + 7))

if __name__ == '__main__':
    s = Solution()
    f = s.fib(5)
    print(f)